package com.swallow.auth.common.utils;

import com.swallow.auth.common.enums.ErrorCode;

import java.text.MessageFormat;
import java.util.Locale;

/**
 * @author: 18310740596@163.com
 * @date: 2024-05-10 23:48:04
 * @version: v1.0
 * @describe: 错误参数替换工具类
 */
public class MessageFormatUtils {

    public static String msgFormat(ErrorCode errorCode, String... params) {
        MessageFormat messageFormat = new MessageFormat(errorCode.getName(), Locale.getDefault());
        return messageFormat.format(params);
    }
}
